﻿using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
using System.Reflection;
using log4net;

namespace AnyOffice.general.system.diary
{
    public partial class index : ModulePage
    {

        private static ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                this.txtLockTime.Value = new DiaryDao().GetLockTime(base.Conn).ToString();
            }
            if (this.Page.IsPostBack)
            {
                this.pnlMain.Visible = false;
                try
                {
                    new DiaryDao().SetLockTime(base.Conn, Convert.ToInt32(this.txtLockTime.Value));
                }
                catch (Exception exception)
                {
                    if (log.IsErrorEnabled)
                    {
                        log.Error("", exception);
                    }
                }
                this.litMessage.Text = base.ShowPrompt("设置成功！");
            }
        }
 

    }
}
